<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="用户授权" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		parent.ClosePop();
	}
	function doSelect(){
		var type="";
		if(document.getElementById("set_type0").checked){
			type="PERSONAL;0";
		}else if(document.getElementById("set_type1").checked){
			var templateId=document.getElementById("template_id").value;
			if(templateId=="" || templateId=="0"){
				ShowAlert('提示框','请选择复制权限的用户',200,100);
				return;
			}
			type="COPY;"+templateId;
		}else{
			return;
		}
		parent.popRetVal=type;
		parent.ClosePop();
	}
	function checkType(){
		if(document.getElementById("set_type1").checked){
			selectTemplate();
		}
	}
	function selectTemplate(){
		var url="/system/UserListForSelect.ihtm";
		ShowIframeNoScroll("选择用户",url,620,500,"selectTemplateCallBack()");
	}
	function selectTemplateCallBack(){
		if(popRetVal!=null){
			document.getElementById("template_id").value=popRetVal[0];
			document.getElementById("template_name").value=popRetVal[1]+"("+popRetVal[3]+")";
			document.getElementById("set_type1").checked=true;
		}
	}
	function doInit(){
		showFormErrorMsg();
	}
</script>
<body oncontextmenu="return false" onload="doInit();" scroll="no"  class="sheet modal-dialog" style=" padding-top:15px;text-align:center;">
<div class="sheet-main" id="bodyDiv" style="width:390px;">
	<form name="frm" method="post">
	  <div class="sheet-list" style="width:100%">
	    <div class="modal-main search-business">
	    	<div style="width:100%;">
				<c:set var="pageTopTitle" value="用户授权" />
				<%@ include file="../inc/PageTop.jsp"%> 
				<table border="0" cellspacing="1" cellpadding="1" class="table-0">
					<tr>
						<th style="width:25%">第一种方法：</th>
						<td style="width:75%" align="left">
							<input type="radio" name="set_type" id="set_type0" checked="true" onClick="checkType();">个性化授权
						</td>
					</tr>
					<tr>
						<th>第二种方法：</th>
						<td align="left">
							<input type="radio" name="set_type" id="set_type1" onClick="checkType();">从已有用户中复制权限，减少授权的工作量
						</td>
					</tr>
					<tr>
						<th>&nbsp;</th>
						<td align="left">
							<input type="text" class="TextBox readonly" readOnly="true" name="template_name" id="template_name">
							<input type="hidden" name="template_id" id="template_id" value="">
							<img class="make-a" src="/images/make-a.gif" style="cursor:pointer;" onClick="selectTemplate();"/>
						</td>
					</tr>
				</table>
			</div>
	  	</div>
	  </div>
		<div class="modal-buttom">
			<input type="button" class="buttom-a" value="确定" onClick="doSelect();">
			<input type="button" class="buttom-a" value="取消" onClick="doCancel();">					
		</div>
	</form>
</div>		
</body>
</html>